package builder;

import java.math.BigDecimal;
import java.time.LocalDate;

/**
 * @ClassName Bill
 * @Description TODO
 * @Author leejiliang
 * @DateTime 2021/7/16 11:10
 * @Version 1.0
 */
public class Bill {

	private Long id;

	private String billNo;

	private String other;

	private String type;

	private LocalDate payDate;

	private BigDecimal amount;

	private String memo;

	private Bill(Builder builder) {
		this.id = builder.id;
		this.billNo = builder.billNo;
		this.other = builder.other;
		this.type = builder.type;
		this.payDate = builder.payDate;
		this.amount = builder.amount;
		this.memo = builder.memo;
	}

	public static class Builder {
		private Long id;

		private String billNo;

		private String other;

		private String type;

		private LocalDate payDate;

		private BigDecimal amount;

		private String memo;

		public Builder(BigDecimal amount, String other) {
			this.amount = amount;
			this.other = other;
		}

		public Builder setId(Long id) {
			this.id = id;
			return this;
		}

		public Builder setBillNo(String billNo) {
			this.billNo=billNo;
			return this;
		}

		public Builder setType(String type) {
			this.type=type;
			return this;
		}

		public Builder setPayDate(LocalDate payDate) {
			this.payDate = payDate;
			return this;
		}

		public Builder setMemo(String memo) {
			this.memo = memo;
			return this;
		}

		public Bill build() {
			return new Bill(this);
		}
	}

}
